package com.woniuxy.shiro.service.impl;

import com.woniuxy.shiro.entity.User;
import com.woniuxy.shiro.mapper.UserMapper;
import com.woniuxy.shiro.service.UserService;
import org.apache.shiro.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;

    @Override
    public User findUserByAccount(String account) {
        System.out.println(SecurityUtils.getSubject().getSession().getAttribute("name"));
        return userMapper.findUserByAccount(account);
    }

    @Override
    public User findUserAndRolesByAccount(String account) {

        return userMapper.findUserAndRolesByAccount(account);
    }
}
